package psico_test.appEjecutar.gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Vector;

import javax.realtime.Clock;
import javax.swing.JFrame;

import psico_test.appEjecutar.ManagerEjecucion;

public class ventanaPulsador extends JFrame implements Runnable, ActionListener
{
	private static final long serialVersionUID = 1L;
	
	private ManagerEjecucion controller;
	private Vector tiemposRespuesta;
	public Vector getTiemposRespuesta()
	{return tiemposRespuesta;}
	
	public ventanaPulsador(ManagerEjecucion controller)
	{
		this.controller = controller;
		this.tiemposRespuesta = new Vector();
	}

	public void run() 
	{
		this.setUndecorated(true);
		initComponents();
		this.setVisible(true);
		this.setLocationRelativeTo(null);
	}

	private void initComponents() 
	{

		panelFondo = new javax.swing.JPanel();
		buttonIcon1 = new org.edisoncor.gui.button.ButtonIcon();

		setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
		setBackground(java.awt.Color.cyan);

		panelFondo.setBackground(java.awt.SystemColor.textText);

		buttonIcon1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/pulsador.png"))); // NOI18N

		org.jdesktop.layout.GroupLayout panelFondoLayout = new org.jdesktop.layout.GroupLayout(panelFondo);
		panelFondo.setLayout(panelFondoLayout);
		panelFondoLayout.setHorizontalGroup(
				panelFondoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
				.add(panelFondoLayout.createSequentialGroup()
						.addContainerGap()
						.add(buttonIcon1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
						.addContainerGap())
		);
		panelFondoLayout.setVerticalGroup(
				panelFondoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
				.add(panelFondoLayout.createSequentialGroup()
						.addContainerGap()
						.add(buttonIcon1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
						.addContainerGap())
		);

		org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(
				layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
				.add(panelFondo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
		);
		layout.setVerticalGroup(
				layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
				.add(panelFondo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
		);
		this.buttonIcon1.addActionListener(this);
		pack();
	}
	
	private org.edisoncor.gui.button.ButtonIcon buttonIcon1;
	private javax.swing.JPanel panelFondo;
	           

	public void actionPerformed(ActionEvent e)
	{
		tiemposRespuesta.add(Clock.getRealtimeClock().getTime());	
	}

}
